<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sitemesh" uri="http://www.opensymphony.com/sitemesh/decorator" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<div class="panel_container">
    <div class="panel">
        <form id="form_password" method="post" action="${ctx}/reportConfig/updateConfig">
            <input type="hidden" name="id" value="${config.id}"/>
            <div class="panel_header">
                <div><h2>上报类型配置</h2></div>
            </div>
            <div class="panel_body">
                <div>
                    <div>
                        <div class="info_item"><span>上报生成类型:<b>*</b></span>
                            <select name="type" >
                                <c:forEach var="entry" items="${dictionaryList}">
                                    <option value="${entry.codeValue}" <c:if test="${config.type==entry.codeValue}">selected="selected"</c:if> >${entry.codeDesc}</option>
                                </c:forEach>
                            </select>
                        </div>
                        <div class="info_item"><span>数据导入方式:<b>*</b></span>
                            <select name="importType" >
                                <c:forEach var="entry" items="${impList}">
                                    <option value="${entry.codeValue}" <c:if test="${config.importType==entry.codeValue}">selected="selected"</c:if> >${entry.codeDesc}</option>
                                </c:forEach>
                            </select>

                        </div>
                    </div>
                </div>

            </div>
            <div class="panel_footer">
                <div>
                    <input type="submit" value="保存" class="btn_blue" id="btn_save"/>
                </div>
            </div>
        </form>
    </div>
</div>
<script type="text/javascript">


    $(function (){

        $("#form_password").validate({
            rules:{
                type: "required",
            },
            messages:{
                defaultPassword: "生成类型必填"
            },
            submitHandler: function(form) {
                $(form).ajaxSubmit({
                    success: function(response) {
                        var data = $.parseJSON(response);
                        if(data.result=="true"){
                            $.prompt("保存成功");
                        }
                    },

                    error: function(response){
                        $.prompt("保存失败:"+response,"错误");
                    }
                });
            }
        });

    });


</script>
